package com.service.impl;

import com.entity.Grade;
import com.mapper.GradeMapper;
import com.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*

 */
@Service
public class GradeServiceImpl implements GradeService {

    @Autowired
    private GradeMapper gradeMapper;


    /*
     映射mapper中的查询所有
     */
    @Override
    public List<Grade> findAll() {
        return gradeMapper.findGradeAll();
    }

    /*
    映射mapper中的name值查询
   */
    @Override
    public List<Grade> findGradeName() {
        return gradeMapper.findGradeName();
    }

    /*
    映射mapper中的查询所有ID值查询
   */
    @Override
    public Grade findGradeById(int gid) {
        return gradeMapper.findGradeById(gid);
    }

    @Override
    public Grade findGradeWithStudentById(int gid) {
        return gradeMapper.findGradeWithStudentById(gid);
    }

    /*
    映射mapper中的添加
   */
    @Override
    public void saveGrade(Grade grade) {
        gradeMapper.saveGrade(grade);
    }

    /*
    根据ID值删除
     */
    @Override
    public void delGradeById(int gid) {
        gradeMapper.delGradeById(gid);
    }

    /*
    删除多条数据
     */
    @Override
    public void delGradeByIds(String[] gids) {
        gradeMapper.delGradeByIds(gids);
    }

    /*
    根据ID值更新
     */
    @Override
    public void updateGradeById(Grade grade) {
        gradeMapper.updateGradeById(grade);
    }




}
